3.198 \(\int \frac {\tan (x)}{\sec (x)-\tan (x)} \, dx\)

Optimal. Leaf size=15 \[ \frac {\cos (x)}{1-\sin (x)}-x \]

[Out]

-x+cos(x)/(1-sin(x))

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4391, 2735, 2648} \[ \frac {\cos (x)}{1-\sin (x)}-x \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]/(Sec[x] - Tan[x]),x]

[Out]

-x + Cos[x]/(1 - Sin[x])

Rule 2648

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Simp[Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 4391

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int \frac {\tan (x)}{\sec (x)-\tan (x)} \, dx &=\int \frac {\sin (x)}{1-\sin (x)} \, dx\\ &=-x+\int \frac {1}{1-\sin (x)} \, dx\\ &=-x+\frac {\cos (x)}{1-\sin (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 29, normalized size = 1.93 \[ \frac {2 \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )}-x \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]/(Sec[x] - Tan[x]),x]

[Out]

-x + (2*Sin[x/2])/(Cos[x/2] - Sin[x/2])

________________________________________________________________________________________

fricas [A]  time = 0.53, size = 28, normalized size = 1.87 \[ -\frac {{\left (x - 1\right )} \cos \relax (x) - {\left (x + 1\right )} \sin \relax (x) + x - 1}{\cos \relax (x) - \sin \relax (x) + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(sec(x)-tan(x)),x, algorithm="fricas")

[Out]

-((x - 1)*cos(x) - (x + 1)*sin(x) + x - 1)/(cos(x) - sin(x) + 1)

________________________________________________________________________________________

giac [A]  time = 1.95, size = 14, normalized size = 0.93 \[ -x - \frac {2}{\tan \left (\frac {1}{2} \, x\right ) - 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(sec(x)-tan(x)),x, algorithm="giac")

[Out]

-x - 2/(tan(1/2*x) - 1)

________________________________________________________________________________________

maple [A]  time = 0.07, size = 15, normalized size = 1.00 \[ -\frac {2}{\tan \left (\frac {x}{2}\right )-1}-x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)/(sec(x)-tan(x)),x)

[Out]

-2/(tan(1/2*x)-1)-x

________________________________________________________________________________________

maxima [A]  time = 1.34, size = 28, normalized size = 1.87 \[ -\frac {2}{\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1} - 2 \, \arctan \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(sec(x)-tan(x)),x, algorithm="maxima")

[Out]

-2/(sin(x)/(cos(x) + 1) - 1) - 2*arctan(sin(x)/(cos(x) + 1))

________________________________________________________________________________________

mupad [B]  time = 0.58, size = 14, normalized size = 0.93 \[ -x-\frac {2}{\mathrm {tan}\left (\frac {x}{2}\right )-1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-tan(x)/(tan(x) - 1/cos(x)),x)

[Out]

- x - 2/(tan(x/2) - 1)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan {\relax (x )}}{- \tan {\relax (x )} + \sec {\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(sec(x)-tan(x)),x)

[Out]

Integral(tan(x)/(-tan(x) + sec(x)), x)

________________________________________________________________________________________